package com.itheima.test0906.test06;

public class CalculatorDemo {
    public static void main(String[] args) {
        useCaculator(new Calculator() {
            @Override
            public int cale(int a, int b) {
                return a+b;
            }
        });

        useCaculator((a,b)->{
            return a+b;
        });
    }

    public static void useCaculator(Calculator calculator){
        int res = calculator.cale(3, 7);
        System.out.println(res);
    }
}

interface Calculator{
    int cale(int a  , int b);
}
